package com.sskj.aikeeper.presenter;


import com.lzy.okgo.model.Response;
import com.sskj.aikeeper.bean.HeadBean;
import com.sskj.aikeeper.hangqing.activity.UserInfoActivity;
import com.sskj.common.base.HttpData;
import com.sskj.lib.BaseHttpConfig;
import com.sskj.lib.http.JsonCallBack;

import org.jsoup.Connection;

import java.io.File;

/**
 * @author Hey
 * Create at  2019/06/25
 */
public class UserInfoPresenter extends BasePresenter<UserInfoActivity> {

    public void uploadHead(File head) {
        httpService.uploadHead(head)
                .tag(this)
                .execute(new JsonCallBack<HttpData<HeadBean>>(this) {
                    @Override
                    public void onSuccess(Response<HttpData<HeadBean>> response) {
                        if (response.body().status == BaseHttpConfig.OK) {
                            mView.uploadHeadOK(response.body().getData());
                        }
                    }
                });
    }
}
